package homework;

/**
 * @Author Stringzhua
 * @Date 2024/2/29 20:59
 * description:设计一个Dog类有名字、年龄、颜色属性,定义输出方法show()显示其信息,并创建对象,进行测试
 * this.属性
 */
public class homework07 {
    public static void main(String[] args) {
        Dog dog = new Dog("爪爪", 20, "black");
        dog.show();
    }
}

class Dog {
    String name;
    int age;
    String color;

    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void show() {
        System.out.println("名字=" + this.name + " 年龄=" + this.age + " 颜色=" + this.color);
    }
}

